

OBJ=obj
SRC=src
EXE=bin
CPPFLAGS=-c -g -O0
CXX=g++

SRCFILES=
OBJFILES=$(OBJ)/addIntegers.o \
         $(OBJ)/shuffleDeck.o \
         $(OBJ)/selNum.o \
         $(OBJ)/calcTwos.o \
         $(OBJ)/modifiedBinarySearch.o \
         $(OBJ)/findLargestnNum.o \
         $(OBJ)/heapSort.o \
         $(OBJ)/strComb.o \
         $(OBJ)/calcMedian.o \
         $(OBJ)/calcWordDistance.o \
         $(OBJ)/transformWord.o \
         $(OBJ)/mySuffixTree.o \
         $(OBJ)/calcMaxSquare.o \
         $(OBJ)/calcMaxSubmatrix.o \
         $(OBJ)/suffixArray.o \
         $(OBJ)/graphTraverse.o \
         $(OBJ)/graphTraverseC.o \
         $(OBJ)/hashtable.o

all: testAdd.exe \
     testShuffleDeck.exe \
     testSelNum.exe \
     testCalcTwos.exe \
     testBinSearch.exe \
     testFindElem.exe \
     testHeapSort.exe \
     testStrComb.exe \
     testCalcMedian.exe \
     testCalcMinDist.exe \
     testWordTransformation.exe \
     testSuffixTree.exe \
     testCalcMaxSquare.exe \
     testCalcMaxSubmatrix.exe \
     testSuffixArray.exe \
     testGraphTraverse.exe \
     install

testAdd.exe : $(OBJ)/testAdd.o $(OBJFILES)
	$(CXX) -o $@ $^

testShuffleDeck.exe : $(OBJ)/testShuffleDeck.o $(OBJFILES)
	$(CXX) -o $@ $^

testSelNum.exe : $(OBJ)/testSelNum.o $(OBJFILES)
	$(CXX) -o $@ $^

testCalcTwos.exe : $(OBJ)/testCalcTwos.o $(OBJFILES)
	$(CXX) -o $@ $^

testBinSearch.exe : $(OBJ)/testBinSearch.o $(OBJFILES)
	$(CXX) -o $@ $^

testFindElem.exe : $(OBJ)/testFindElem.o $(OBJFILES)
	$(CXX) -o $@ $^

testHeapSort.exe : $(OBJ)/testHeapSort.o $(OBJFILES)
	$(CXX) -o $@ $^

testStrComb.exe : $(OBJ)/testStrCombination.o $(OBJFILES)
	$(CXX) -o $@ $^

testCalcMedian.exe : $(OBJ)/testCalcMedian.o $(OBJFILES)
	$(CXX) -o $@ $^

testCalcMinDist.exe : $(OBJ)/testCalcMinDist.o $(OBJFILES)
	$(CXX) -o $@ $^

testWordTransformation.exe : $(OBJ)/testWordTransformation.o $(OBJFILES)
	$(CXX) -o $@ $^

testSuffixTree.exe : $(OBJ)/testSuffixTree.o $(OBJFILES)
	$(CXX) -o $@ $^

testCalcMaxSquare.exe : $(OBJ)/testCalcMaxSquare.o $(OBJFILES)
	$(CXX) -o $@ $^

testCalcMaxSubmatrix.exe : $(OBJ)/testCalcMaxSubmatrix.o $(OBJFILES)
	$(CXX) -o $@ $^

testSuffixArray.exe : $(OBJ)/testSuffixArray.o $(OBJFILES)
	$(CXX) -o $@ $^

testGraphTraverse.exe : $(OBJ)/testGraphTraverse.o $(OBJFILES)
	$(CXX) -o $@ $^

$(OBJ)/%.o : $(SRC)/%.cpp
	$(CXX) $(CPPFLAGS) -o $@ $<

install:
	mv *.exe $(EXE)/.

clean:
	rm -rf 	$(OBJ)/*.o $(EXE)/*.exe
